<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.sql.*"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:useBean id="dbConnection" scope="session" class="DB.DBConnection"/>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>公告管理</title>
    <script type="text/javascript" src="admin.js"></script>
  </head>

  
<body>
	<table width="100%">
	<tr>
		<td width="20%">
		<%=session.getAttribute("username")%>管理员，欢迎你到来！
		</td>
		<td width="80%" align="right"><a href="/209ChatRoom/chat/main.jsp">回到聊天室</a>
		</td>
	</tr>
	</table>
<hr />
<span class="STYLE1">公告管理：</span>
<hr />
<form name="form1" action="">
<%
  dbConnection.getConnection();
  String sql="select * from proclaim";
  ResultSet rs=dbConnection.executeQuery(sql);
  int num=dbConnection.executeCount(sql);
%>
  <table width="100%" border="1">
  	<tr>
  		
		<td width="76%">公告内容</td>
		<td width="9%">管理员</td>
		<td width="10%">时间</td>
		
		<td width="5%">删除</td>
  	</tr>
<% while(rs.next()){%>
	<tr>
		<td width="76%"><%=rs.getString("content")%></td>
		<td width="9%"><%=rs.getString("admin")%></td>
		<td width="10%"><%=rs.getString("DateTime")%></td>
	
		<td width="5%"><a href="del.jsp?id=<%=rs.getString("Id")%>">删除</a></td>
  	</tr>
<%}dbConnection.closeConn();%>  	
  </table>
</form>
<hr />
<center>
		<a href="change.jsp?id=0">添加新公告</a>
</center>
<hr />
<center>
  Copyrigh for xiyou209
<hr />
</center>
</body> 
</html>